<%@ page language="java" contentType="application/octet-stream;charset=utf-8" %>
<%@ include file="/admin/include/init_admin.jsp" %>
<%@ page import="com.welfare.admin.call.*" %>
<%
	out.clear();
	out = pageContext.pushBody(); 
	
	
	String excelTitle = "상담목록";
	
	response.setHeader("Content-Disposition","attachment;filename="+java.net.URLEncoder.encode(excelTitle, "utf-8")+"_"+StringUtil.today()+".xls");
	response.setHeader("Content-Description","JSP Generated Data");

	String sort_col				= StringUtil.nvl(request.getParameter("sort_col"), "counsel_id");
	String sort_asc				= StringUtil.nvl(request.getParameter("sort_asc"), "asc");
	
	String counsel_path			= StringUtil.nvl(request.getParameter("counsel_path"));
	String counsel_date_from	= StringUtil.nvl(request.getParameter("counsel_date_from"));
	String counsel_date_to		= StringUtil.nvl(request.getParameter("counsel_date_to"));
	String reg_user				= StringUtil.nvl(request.getParameter("reg_user"));
	String customer_name		= StringUtil.nvl(request.getParameter("customer_name"));
	String birth_date			= StringUtil.nvl(request.getParameter("birth_date"));
	String hp_no				= StringUtil.nvl(request.getParameter("hp_no"));
	String counsel_kind			= StringUtil.nvl(request.getParameter("counsel_kind"));
	String counsel_part			= StringUtil.nvl(request.getParameter("counsel_part"));
	String alarm_code			= StringUtil.nvl(request.getParameter("alarm_code"));
	
	
	HashMap infos = new HashMap();
	infos.put("use_yn", "Y");
	infos.put("sort_col", sort_col);
	infos.put("sort_asc", sort_asc);
	infos.put("counsel_path", counsel_path);
	infos.put("counsel_date_from", counsel_date_from);
	infos.put("counsel_date_to", counsel_date_to);
	infos.put("reg_user", reg_user);
	infos.put("customer_name", customer_name);
	infos.put("birth_date", birth_date);
	infos.put("hp_no", hp_no);
	infos.put("counsel_kind", counsel_kind);
	infos.put("counsel_part", counsel_part);
	infos.put("alarm_code", alarm_code);
	


	CallDAO dao 	= new CallDAO();
	HashList list 	= dao.selectCounselList(infos);

	list.setHeader("counsel_path",			"상담경로",		MetaData.ALIGN_LEFT);
	list.setHeader("counsel_date",			"상담일시",		MetaData.ALIGN_LEFT);
	list.setHeader("customer_name", 		"고객명",		MetaData.ALIGN_LEFT);
	list.setHeader("birth_date", 			"생년월일",		MetaData.ALIGN_LEFT);
	list.setHeader("dong_name", 			"행정동",		MetaData.ALIGN_LEFT);
	list.setHeader("support_gubn", 			"보장구분",		MetaData.ALIGN_LEFT);
	list.setHeader("counsel_kind1",			"분류(a)1",		MetaData.ALIGN_LEFT);
	list.setHeader("counsel_part1",			"분류(a)2",		MetaData.ALIGN_LEFT);
	list.setHeader("counsel_kind2",			"분류(b)1",		MetaData.ALIGN_LEFT);
	list.setHeader("counsel_part2",			"분류(b)2",		MetaData.ALIGN_LEFT);
	list.setHeader("counsel_kind3",			"분류(c)1",		MetaData.ALIGN_LEFT);
	list.setHeader("counsel_part3",			"분류(c)2",		MetaData.ALIGN_LEFT);
	list.setHeader("service_name", 			"서비스명",		MetaData.ALIGN_LEFT);
	list.setHeader("question", 				"상담질문",		MetaData.ALIGN_LEFT);
	list.setHeader("answer", 				"상담답변",		MetaData.ALIGN_LEFT);
	list.setHeader("note", 					"특이사항",		MetaData.ALIGN_LEFT);
	list.setHeader("counsel_result_name", 	"상담결과",		MetaData.ALIGN_LEFT);
	list.setHeader("counseller", 			"상담원",		MetaData.ALIGN_LEFT);
	list.setHeader("hp_no", 				"핸드폰번호",		MetaData.ALIGN_LEFT);
	
	list.writeToExcel(response, excelTitle);
%>
						
